﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using WenABP.Customer.Application.Contracts;
using WenABP.Customer.Application.Contracts.Dtos;
using WenABP.Customer.Domain.Entity;

namespace WenABP.Customer.Application
{
    public class CustomerService : ApplicationService, ICustomerService
    {
        private readonly IRepository<Domain.Entity.Customer> customersRepository;

        public CustomerService(IRepository<Domain.Entity.Customer> customersRepository)
        {
            this.customersRepository = customersRepository;
        }

        public async Task<List<CustomerDto>> GetListAsync()
        {
            var listCustomer  = await this.customersRepository.GetListAsync();
            return ObjectMapper.Map<List<Domain.Entity.Customer>, List<CustomerDto>>(listCustomer);
        }
    }
}
